public class Solution441 {
    public int arrangeCoins(int n) {
        return (int)(Math.sqrt((long)8*n+1)-1)/2;
    }

    public static void main(String[] args) {
        System.out.println(new Solution441().arrangeCoins(6));
    }
}
